<?php

$url = explode("/", $_SERVER['HTTP_REFERER']);
if (strcmp($url[count($url) - 1], 'submit.php') != 0) {
  header("Location: submit.php");
}

session_start();

if ( isset($_SESSION['username']) ) { $username = $_SESSION['username']; }
if ( isset($_SESSION['email']) ) { $email = $_SESSION['email']; }
if ( isset($_SESSION['abstract_title']) ) { $abstract_title = $_SESSION['abstract_title']; }
if ( isset($_SESSION['regdate']) ) { $regdate = $_SESSION['regdate']; }

session_unset();
session_destroy();

$_SESSION = array();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <link rel="stylesheet" href="style.css" type="text/css" />
  <title>第四十八屆台灣心理學年會投稿系統</title>
</head>

<body>
  <div id="container">
    <div id="header">
      <h1>投稿<span class="h1_span">失敗</span></h1>
    </div>

    <h2>重複投稿</h2>
    <?php
      $error_msg = sprintf("您（%s）已在 %s 以「%s」進行投稿！<br />若您有任何疑問，十分歡迎您來信詢問，電子郵件地址：b93102063@ntu.edu.tw。", $username, $regdate, $abstract_title);
    ?>
    <p><?php echo $error_msg ?></p>


    <div id="footer">
      <p>&copy; 2009 第四十八屆台灣心理學年會</p>
    </div>

  </div>
</body>
</html>